package com.exmaple.lemlin.ui.fragment;

import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.design.widget.TextInputEditText;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.exmaple.lemlin.R;
import com.exmaple.lemlin.entity.AccessEvenBus;
import com.exmaple.lemlin.ui.abstracts.AbstractBaseFragment;

import org.greenrobot.eventbus.EventBus;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author Administrator
 */
public class AccessSignUpFragment extends AbstractBaseFragment {

    @BindView(R.id.edit_user_name)
    TextInputEditText editUserName;
    @BindView(R.id.edit_password)
    TextInputEditText editPassword;
    @BindView(R.id.edit_password_sure)
    TextInputEditText editPasswordSure;

    public static AccessSignUpFragment newInstance() {
        return new AccessSignUpFragment();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_access_sign_up;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initLazyLoad() {

    }
    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @OnClick({R.id.btn_user_logon})
    public void onViewClicked(View view) {
        AccessEvenBus.Authenticate auth = new AccessEvenBus.Authenticate();
        auth.setUserName(Objects.requireNonNull(editUserName.getText()).toString());
        auth.setUserPwd(Objects.requireNonNull(editPassword.getText()).toString());
        auth.setUserPwdSure(Objects.requireNonNull(editPasswordSure.getText()).toString());
        EventBus.getDefault().post(new AccessEvenBus((this), auth));
    }
}
